home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / sw-44a.zip / SW44DEMO.BAT < prev   
DOS Batch File  |  1992-12-20  |  8KB  |  307 lines

  1. @ECHO OFF
  2. if not %1!==! goto %1
  3.  
  4. :REM A pre-SW screen just for effect
  5. :REM make sure the screen is default white on black
  6. :REM reset border
  7. sw /o
  8. :REM save existing prompt
  9. set sav=%prompt%
  10. :REM make sure there was room in environment
  11. if not %sav%!==%prompt%! goto skip
  12. set prompt=$e[0m$p$g
  13. @echo on
  14. cls
  15. @echo off
  16. echo.
  17. echo.
  18. echo.
  19. echo.
  20. echo.
  21. echo.
  22. echo.
  23. echo                           Are Your Batch Files Dull?
  24. echo.
  25. echo                                    Lifeless?
  26. echo.
  27. echo                                     Boring?
  28. echo.
  29. echo                              SW.EXE is the answer!
  30. echo.
  31. echo.
  32. echo.
  33. echo.
  34. echo.
  35. echo.
  36. echo.
  37. echo.
  38. pause
  39. set prompt=%sav%
  40. set sav=
  41.  
  42. :skip
  43. :REM skip over screen definitions
  44. :REM Put screen definitions at the beginning of the file for fastest execution
  45. goto begin
  46.  
  47. :REM Screen definition with default label
  48. :REM Windows are drawn in the order defined. Pause, Query and User Input will
  49. :REM occur as they are encountered. SW will return only the last Query result.
  50.  
  51. :Display
  52. _window /kcya┼ /r2 /s /bred /w /0 /z
  53. SW.EXE - Expanded Text Handling!
  54. /tWHI+ Multiple Windows!
  55. /m  v 4.4 
  56. _window /r10 /s /bwhi /gblu /l1 /fred /0
  57. /tBLU Optional Command Line Syntax:
  58. SW @filename [label]
  59. _window /r16 /s /bwhi /gblu /l1 /fred /0
  60. /tBLU SW 4.x ADDITIONAL FEATURES
  61. /tred /─
  62. /jl "- Define the entire screen with multiple windows   "
  63.   using external text files.
  64. _window /r25 /l0 /0 /p100- /d
  65. " - Press any key for more - "
  66. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  67. "- Using labels, more than one definition can be    "
  68.   included in the same file.
  69. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  70. "- The screen definition can be included inside the "
  71.   calling batch file!
  72. _window /r19 /bwhi /gblu /l0 /jl /0 /p100-
  73. "- SW can evaluate Environment Variables included   "
  74.   inside screen definitions.
  75. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1 /p100-
  76. "- {NEW!}  Highlighting can be a different color on   "
  77. /ered   each line. Highlight blocks with{ {{braces}}}.
  78. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2 /p100-
  79. "- {BONUS!}  SWV.EXE Text File Viewer available when    "
  80.   registering SW / DI.
  81. _window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a3
  82. "- {BONUS!}  SW-DIR.EXE File Picker available when      "
  83.   registering SW / DI.
  84. _window /r25 /l0 /0 /p200- /d
  85. " - Press any key to continue - "
  86. :end_display
  87.  
  88. :REM screen definition showing a menu with user defined label
  89.  
  90. :Snd_menu
  91. _window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
  92. SW.EXE - Sounds!
  93. /m " v 4.4 "
  94. _window /eRED /r11 /s /l1 /w
  95. /mc ┤ Play a Sound ├
  96. "~Low Tone   ~Mid Tone   ~High Tone"
  97. "Bweep ~1    Bweep ~2    ~Bomb     "
  98. "~Siren      ~Phasor     ~Tweeter  "
  99. /tYEL /─
  100. Close ~Encounters   ~Charge 
  101. ~WZLX
  102. /m < {ESC} >
  103. :end_Snd_menu
  104.  
  105. :REM screen definition showing a menu with another user defined label
  106.  
  107. :4.4
  108. _window /r125 /c180 /z /bwhi /l0 /o
  109.  
  110. _window /kwhi┴───┬── /r4 /bred /w /0 /z /kblu /@-
  111. SW.EXE - Bye, Bye ECHO!
  112. /m  v 4.4 
  113. _window /tRED /r11 /fWHI
  114. They can also be placed anywhere on the screen they'll fit!
  115. _window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
  116. Upper Left
  117. _window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
  118. Upper Right
  119. _window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
  120. Lower Right
  121. _window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
  122. Lower Left
  123. _window /r18 /fWHI /tYEL+ /b4 /l5
  124. (c) 1992   Warren Small
  125. :end_4.4
  126.  
  127. :Charge
  128. _window /aC4,2
  129. _window /aF4,2
  130. _window /aA4,2
  131. _window /aC5,4
  132. _window /aA4,2
  133. _window /aC5,5
  134. :End_Charge
  135.  
  136. :Close
  137. _window /aA4,3
  138. _window /aB4,3
  139. _window /aG4,3
  140. _window /aG3,3
  141. _window /aD4,10
  142. :End_Close
  143.  
  144. :WZLX
  145. _window /aE5
  146. _window /aG5
  147. _window /aB5
  148. _window /aE6
  149. _window /aB5
  150. _window /aG5
  151. _window /aE5
  152. :End_WZLX
  153.  
  154. :REM labels for Alert sounds demos near the beginning of file 
  155. :REM for faster execution
  156.  
  157. :beep1
  158. sw /a1
  159. goto BeepDemo
  160.  
  161. :beep2
  162. sw /a2
  163. goto BeepDemo
  164.  
  165. :beep3
  166. sw /a3
  167. goto BeepDemo
  168.  
  169. :beep4
  170. sw /a4
  171. goto BeepDemo
  172.  
  173. :beep5
  174. sw /a5
  175. goto BeepDemo
  176.  
  177. :beep6
  178. sw /a6
  179. goto BeepDemo
  180.  
  181. :beep7
  182. sw /a7
  183. goto BeepDemo
  184.  
  185. :beep8
  186. sw /a8
  187. goto BeepDemo
  188.  
  189. :beep9
  190. sw /a9
  191. goto beepdemo
  192.  
  193. :beep10
  194. sw @sw44demo.bat charge
  195. goto beepdemo
  196.  
  197. :beep11
  198. sw @sw44demo.bat close
  199. goto beepdemo
  200.  
  201. :beep12
  202. sw @sw44demo.bat WZLX
  203. goto beepdemo
  204.  
  205. :REM Alternate errorlevel check using FOR loop
  206.  
  207. :beepdemo
  208. sw /q~lmh12bsptcew
  209. for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
  210. if errorlevel 0 goto DI
  211.  
  212. :REM Command line examples, positioning, colors, shadows, pause, Wide edge
  213. :REM Color numbers are used to shorten the line
  214. :REM Command line cannot exceed 128 characters
  215.  
  216. :begin
  217. sw /r125 /c180 /z /l0 " " /bwhi
  218. sw /kwhi[_] /kred /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.4 " /o /z
  219. sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
  220. sw /r18 /l3 /t11 "Display up to 50 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
  221. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  222.  
  223. :REM More command line examples, justify, borders
  224.  
  225. sw /kcya░ /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.4 " /z
  226. sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
  227. sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
  228. sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
  229. sw /bwhi /r19 /gyel /l0 /0 /c68 /jr " Justify " "Text " "Right "
  230. sw /r25 /l0 /0 " - Press any key to continue - " /p100-
  231.  
  232. set colr=bla
  233. :REM Make sure there was room in the environment
  234. if not "%colr%"=="bla" goto next
  235.  
  236. :REM Another command line example, Query with default, Border Message, Draw
  237. :REM Draw a full screen window
  238. sw /r125 /c180 /o1 " "
  239. sw /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.4 " /z
  240.  
  241. :REM The following line is longer than 128 characters BUT it works because 
  242. :REM when the line is processed by DOS, the %colr% variable is replaced by
  243. :REM the color value making the command line 3 characters shorter.
  244.  
  245. :colors
  246. sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown  ~Cyan  ~White  ~Green" "Press ~E~S~C to go on..." /q~bcwg /2 /l5 /d
  247.  
  248. if errorlevel 4 set colr=gre
  249. if errorlevel 4 goto colors
  250. if errorlevel 3 set colr=whi
  251. if errorlevel 3 goto colors
  252. if errorlevel 2 set colr=cya
  253. if errorlevel 2 goto colors
  254. if errorlevel 1 set colr=yel
  255. if errorlevel 1 goto colors
  256.  
  257. :next
  258. set colr=
  259.  
  260. :REM Display screen definition with default label
  261. sw @sw44demo.bat
  262.  
  263. :REM Display screen definition in external file
  264. sw @sw-44.new
  265.  
  266. :REM Display screen definition with label 'menu'
  267. sw @sw44demo.bat Snd_menu
  268.  
  269. :REM Query is handled separately beacause I wanted to return to the menu
  270. :REM after processing the response without redoing the screen.
  271. :REM I also placed it nearer the top of the file to speed it up.
  272. goto beepdemo
  273.  
  274. :REM create screen definition on the fly to demo DI.EXE
  275. :DI
  276. if exist di.hlp goto DI_Display
  277. sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
  278. echo :REM This file was created by SW44DEMO.BAT > di.hlp
  279. echo :REM If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
  280. echo :REM                       "SW @DI.HLP" >> di.hlp
  281. echo.>> di.hlp
  282. echo :Display >> di.hlp
  283. echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
  284. echo SW.EXE - Now with DI!>> di.hlp
  285. echo /mc  v 4.4 >> di.hlp
  286. echo _window /jl /s /0 /r9 >> di.hlp
  287. echo /mc  Disk Information >> di.hlp
  288. echo.>> di.hlp
  289. di >> di.hlp
  290. echo. >> di.hlp
  291. echo /m /eYEL "~╡ Press any key to continue ~╞">> di.hlp
  292. echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
  293. echo :End_Display >> di.hlp
  294. :DI_Display
  295. sw @di.hlp
  296.  
  297. :REM Display screen definition with label '4.4'
  298. :final
  299. sw @sw44demo.bat 4.4
  300. for %%t in (10 9 8 7 6 5 4 3 2 1) do sw /r25 /l0 /0 /a10000,1 /p8- " - Pausing %%t seconds - " /@-
  301. sw /r25 /l0 /0 /a60,1 /p2 " - Outta Here! - "
  302. if exist sw-big.sw sw @sw-big.sw
  303.  
  304. :REM display help screen
  305. :help
  306. sw
  307.